package com.dyc.maitaole.controller;

import com.dyc.maitaole.entity.BasicInfo;
import com.dyc.maitaole.service.BasicInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

@Controller
@RequestMapping("/basic")
public class BasicInfoController {
    @Autowired
    private BasicInfoService basicInfoService;

    @RequestMapping("/infos")
    public ModelAndView findAll(Integer goodId,String goodName,String goodImg,String goodCost){
        List<BasicInfo> basicInfos = basicInfoService.findAll(goodId);
        ModelAndView modelAndView = new ModelAndView("/assess.jsp");
        modelAndView.addObject("goodId",goodId);
        modelAndView.addObject("goodName",goodName);
        modelAndView.addObject("goodImg",goodImg);
        modelAndView.addObject("goodCost",goodCost);
        modelAndView.addObject("basicInfos",basicInfos);
        return modelAndView;
    }
}
